<?php // no direct access
/* 
Module latest news for joomla 1.5
Slice effect by Jquery
Develope by Tranquang
At Vinazoom co., Ltd
website:  www.vinazoom.com
License GNU/GPL
*/
defined('_JEXEC') or die('Restricted access'); ?>

<?php if(count($list) > 0){?>

<div class="main_lastnews_module<?php echo $params->get('moduleclass_sfx') ?>">
	<div id="main_lastnews_module_top">
        <div class="menucon">
            <div class="menu_itemcon over1 fl">
               <?php if($list[0]) { ?>
						<a href="<?php echo $list[0]->linkSec; ?>">
						<span class = 'title_sumary'> <?php if ($module->showtitle != 0) : ?>         
                 		<?php echo $module->title; ?>                    
            		<?php endif; ?></span>
            		</a>
					<?php }?> 
                
            </div>
        </div>
    </div>
	<div id="main_lastnews_module_mid">
		<table cellpadding="0" cellspacing="0" <?php echo $w_slice?> <?php echo $h_slice?>>
				<?php if($list[0]) { ?>
				<tr>
					<?php 
					
					$colspan = '';
					
					if ($list[0]->img){ ?>
					<td width="110px">
						<div class="content_top_img"><a href="<?php echo $list[0]->link; ?>">
		                            <img src="<?php echo $list[0]->img; ?>" <?php echo $w_image; ?> <?php echo $h_image; ?> alt="photo" align="left" class="img1"/></a>
		                </div>
					
					</td>
					 <?php 
							
					}else
					{
						$colspan = 'colspan = \'2\'';
					}
					
					?>
					<td <?php echo $colspan?> width="240" >
						<div class="content_top_detail_text">
		                    <a href="<?php echo $list[0]->link; ?>" class="latestnewstq<?php echo $params->get('moduleclass_sfx'); ?>"><?php echo $list[0]->text; ?><br /></a>
		                    <p style = "text-transform:lowercase">
		                    <?php
								
		                        $chuoi = strip_tags($list[0]->intro);
								
		                        $maxleng = strlen($chuoi);
								if($maxChar == 0 || $maxleng < $maxChar){
									$gioihan = $maxleng;
								}else{
									$gioihan = $maxChar;
								}
				
								
								if(strpos($chuoi," ",$gioihan) >= $gioihan){
									$new_gioihan=strpos($chuoi," ",$gioihan);
									$new_chuoi = substr($chuoi,0,$new_gioihan)." [...]";
								}else{
									$new_chuoi = $chuoi;
								}
		                      
		                        echo  $new_chuoi;
		                    ?>
							</p>
							<p class = 'readmore_sumary'>
								 <a href="<?php echo $list[0]->link; ?>" ><?php echo JText::sprintf('Read more...');?></a>
								
							</p>
		                </div>
					
					</td>
					<?php 
					if ($list[1]){ ?>
					<td width="20px"></td>
					<?php 
					if ($list[1]->img){ ?>
					<td width="110px">
						<div class="content_top_img"><a href="<?php echo $list[1]->link; ?>">
		                            <img src="<?php echo $list[1]->img; ?>" <?php echo $w_image; ?> <?php echo $h_image; ?> alt="photo" align="left" class="img1"/>
		                            </a>
		                </div>
					
					</td>
					 <?php 
							
					}else
					{
						$colspan = 'colspan = \'2\'';
					}
					
					?>
					<td <?php echo $colspan?> width="240" >
						<div class="content_top_detail_text">
		                    <a href="<?php echo $list[1]->link; ?>" class="latestnewstq<?php echo $params->get('moduleclass_sfx'); ?>"><?php echo $list[1]->text; ?><br /></a>
		                    <p style = "text-transform:lowercase">
		                    <?php
								
		                        $chuoi = strip_tags($list[1]->intro);
		                        
					 			$maxleng = strlen($chuoi);
								if($maxChar == 0 || $maxleng < $maxChar){
									$gioihan = $maxleng;
								}else{
									$gioihan = $maxChar;
								}
								
								if(strpos($chuoi," ",$gioihan) >= $gioihan){
									$new_gioihan=strpos($chuoi," ",$gioihan);
									$new_chuoi = substr($chuoi,0,$new_gioihan)." [...]";
								}else{
									$new_chuoi = $chuoi;
								}
		                      
		                        echo  $new_chuoi;
		                    ?>
							</p>
							<p class = 'readmore_sumary'>
								 <a href="<?php echo $list[1]->link; ?>" ><?php echo JText::sprintf('Read more...');?></a>
								
							</p>
		                </div>
					
					</td>
					<?php } ?>
				</tr>
				<?php } ?>
				<tr>
					<td colspan="5">
					<ul class = "link_module">
						<?php 
							$number = count($list);
							if($number > 2){
								for ($i = 2; $i < $number; $i++){
									?>
										<li>
											<a href="<?php echo $list[$i]->link; ?>" class="latestnewstq<?php echo $params->get('moduleclass_sfx'); ?>"><?php echo $list[$i]->text; ?></a>
										</li>
									<?php
									
								}
								
							}
							
						?>
					</ul>
					</td>
				</tr>
			</table>
	</div>
	<div id="main_lastnews_module_bot">
    </div>
</div>
<?php }?>
